package com.example.controller;

import cn.hutool.http.HttpStatus;
import com.example.model.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @author long
 * @date 2022/11/30 15:12
 */
//@Validated
@RestController
public class ValidateController {

    @PostMapping( "/validate")
    public Result validate(@RequestBody @Valid AreaModel param){
        System.out.println("入参: "+param);
        return Result.builder().code(HttpStatus.HTTP_OK).build();
    }

    @PostMapping("/validateList")
    public Result validateList(@RequestBody @Valid ValidList<AreaModel> paramList){
        System.out.println("入参: "+paramList);
        return Result.builder().code(HttpStatus.HTTP_OK).build();
    }

}

